/*
*
==============================================================================
*  Name        : 
*  Part of     : Omen Game Engine - OpenGL Plugin
*  Description : 
*  Version     : 1.0
*
*  Copyright (c) 2013 Lauri Kortevaara.
* 
==============================================================================
*/

#pragma once

#include <Windows.h>

#include <map>

class OpenGLWindow
{
public:
    OpenGLWindow();
    OpenGLWindow( const OpenGLWindow& other );

    void createWindow( const int& windowWidth, const int& windowHeight, const bool& bFullScreen );
    void swapBuffers();

    int width() const;
    int height() const;

    static LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

    unsigned long windowHandle() const { return reinterpret_cast<unsigned long>(m_hwnd); }
  

private:
    void registerWindowClass();
    void choosePixelFormat();
    void createGLContext();

    static bool keys[256]; // Array Used For The Keyboard Routine
    HWND        m_hwnd;
    HGLRC       m_glRenderingContext;

    int         m_windowWidth, m_windowHeight;

    void renderScene();

    static std::map<HWND,OpenGLWindow*> g_mapHwndGLWindow;
};

